﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="PPAP.Web.Master.Users" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script language="javascript">
        function add() {
            url = "UsersEdit.aspx";
            PopUpWindow(url, 230, 160, 860, 420);
        }
        function edit(id) {
            url = "UsersEdit.aspx?DID=" + id;
            PopUpWindow(url, 230, 160, 860, 420);
        }
        function Sign(name) {
            url = "Signature.aspx?username=" + name;
            PopUpWindow(url, 230, 160, 560, 420);
        }
        function del(id) {
            if (confirm('Please confirm to delete the user.')) {
                url = "Users.aspx?deid=" + id;
                window.location.href = url;
            }
        }
    </script>
</head>
<body style="font-family: Arial, Helvetica, sans-serif;">
    <form id="form1" runat="server">
    <div>
    <font size='-1' color='gray'>Current position:Master data>>User</font>
        <table width="100%" class="table" style="display: none;">
            <tr>
                <td style="width: 25%">
                    Family name
                </td>
                <td style="width: 25%">
                    <asp:TextBox autocomplete="off"   ID="txtFamilyname" runat="server"></asp:TextBox><font color='red'>*</font>
                </td>
                <td style="width: 25%">
                    First name
                </td>
                <td style="width: 25%">
                    <asp:TextBox autocomplete="off"   ID="txtFirstname" runat="server"></asp:TextBox><font color='red'>*</font>
                </td>
            </tr>
            <tr>
                <td>
                    User name
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtUserName" runat="server"></asp:TextBox><font color='red'>*</font>
                </td>
                <td>
                    Email
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtEmail" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Mobile phone
                </td>
                <td style="width: 25%">
                    <asp:TextBox autocomplete="off"   ID="txtMobilephone" runat="server"></asp:TextBox>
                </td>
                <td>
                    Department
                </td>
                <td>
                    <asp:DropDownList ID="ddlDepartment" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Position
                </td>
                <td>
                    <asp:DropDownList ID="ddlPosition" runat="server">
                    </asp:DropDownList>
                </td>
                <td>
                    Execute inspection task？
                </td>
                <td>
                    &nbsp;<asp:RadioButton ID="rbtY" runat="server" Checked="True" GroupName="s" Text="Yes" />
                    &nbsp;<asp:RadioButton ID="rbtN" runat="server" GroupName="s" Text="No" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="left" class="style2">
                    Initial password:123456
                </td>
                <td colspan="2" class="style1">
                    <asp:Button ID="Button1" CssClass="button" runat="server" Text="Add" OnClick="Button1_Click"
                        OnClientClick="return confirm('Are you sure you want to save?');" />
                </td>
            </tr>
        </table>
        <table width="100%">
            <tr>
                <td align="right">
                    <input value="Add" onclick="javascript:add();" class="button" type="button" />
                </td>
            </tr>
        </table>
        <asp:GridView ID="GridView1" runat="server" CellPadding="4" Width="100%" ForeColor="#333333"
            GridLines="None" AutoGenerateColumns="False" AllowSorting="True" OnSorting="GridView1_Sorting">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="No." FooterText="No." HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("rownum") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Family name" FooterText="Family name" HeaderStyle-Font-Size="12px" SortExpression="FAMILYNAME"
                    ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("FAMILYNAME") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="First name" FooterText="First name" HeaderStyle-Font-Size="12px" SortExpression="FIRSTNAME"
                    ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Eval("FIRSTNAME") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="User name" FooterText="UserName" HeaderStyle-Font-Size="12px" SortExpression="username"
                    ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Eval("username") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Position" FooterText="Position" HeaderStyle-Font-Size="12px" SortExpression="POSITION"
                    ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Eval("POSITION") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Department" FooterText="Department" HeaderStyle-Font-Size="12px" SortExpression="department"
                    ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Eval("department") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Email" FooterText="Email" HeaderStyle-Font-Size="12px" SortExpression="EMAIL"
                    ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Eval("EMAIL") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Telephone" FooterText="Telephone" HeaderStyle-Font-Size="12px" SortExpression="MOBILEPHONE"
                    ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Eval("MOBILEPHONE") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:HyperLinkField DataNavigateUrlFields="ID" HeaderStyle-Font-Size="12px" Visible="false"
                    HeaderText="Edit" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"
                    DataNavigateUrlFormatString="Users.aspx?DID={0}" Text="Edit">
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:HyperLinkField>
                <asp:TemplateField HeaderText="Signature" FooterText="Signature" HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <img src="../Images/newimg/write.png" title="Signature" onclick="<%#"javascript:Sign('"+Eval("username")+"')" %>" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="center"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Edit" FooterText="Edit" HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton2" Visible="false" PostBackUrl='<%#"javascript:edit("+Eval("ID")+");" %>'
                            runat="server">Edit</asp:LinkButton>
                        <img src="../Images/newimg/write.png" title="Edit" onclick="<%#"javascript:edit("+Eval("ID")+")" %>" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="center"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete" FooterText="Delete" HeaderStyle-Font-Size="12px" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" Visible="false" runat="server" OnClientClick="return confirm('Please confirm to delete the file.')"
                            PostBackUrl='<%# "Users.aspx?deid="+Eval("ID") %>'>Delete</asp:LinkButton>
                        <img src="../Images/newimg/delete.png" title="Delete" onclick="<%#"javascript:del("+Eval("ID")+")" %>" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" Font-Size="12px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="center"></ItemStyle>
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#2E8AC5" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" ForeColor="#000000" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Left" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <webdiyer:AspNetPager ID="AspNetPager2" runat="server" CssClass="paginator"
            ShowPageIndexBox="Always" PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto"
            HorizontalAlign="Center" PageSize="20" EnableTheming="true" AlwaysShow="True"
            FirstPageText="|&lt;" LastPageText="&gt;|" NextPageText="&gt;" PrevPageText="&lt;"
            SubmitButtonText="Go" TextAfterPageIndexBox="page" InvalidPageIndexErrorMessage="Page index is not effective numerical！"
            OnPageChanged="AspNetPager2_PageChanged" PageIndexOutOfRangeErrorMessage="Page index beyond range"
            BackColor="#E7E8E8">
        </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>
